///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package util;
//
//import session.AccountInformationBeanLocal;
//import session.AccountInformationBeanLocalHome;
//import session.AccountTypeBeanLocal;
//import session.AccountTypeBeanLocalHome;
//import session.AccountBeanLocal;
//import session.AccountBeanLocalHome;
//import java.util.Properties;
//import javax.ejb.CreateException;
//import javax.naming.InitialContext;
//import javax.naming.NamingException;
//
///**
// *
// * @author Giang Nguyen
// */
//public class EJBUtil {
//
//    private static InitialContext ctx;
//
//    private static InitialContext getInitialContext() {
//        Properties p = new Properties();
//        p.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
//        p.put(InitialContext.PROVIDER_URL, "localhost:1099");
//        try {
//            if (ctx != null)
//                return ctx;
//            else {
//                ctx = new InitialContext(p);
//                return ctx;
//            }
//        } catch (NamingException e) {
////            WebUtil.getLogger(EJBUtil.class).debug("getContext throw: " + e.getMessage(), e);
//            return null;
//        }
//    }
//
//    /**
//     * Get AccountTypeBeanLocal
//     * @return AccountTypeBeanLocal
//     * @throws NamingException
//     * @throws CreateException
//     */
//    public static AccountTypeBeanLocal getAccountTypeBeanLocal() throws NamingException, CreateException {
//        AccountTypeBeanLocalHome home = (AccountTypeBeanLocalHome) getInitialContext().lookup("AccountTypeBean");
//        return home.create();
//    }
//
//    /**
//     * Get AccountBeanLocal
//     * @return AccountBeanLocal
//     * @throws NamingException
//     * @throws CreateException
//     */
//    public static AccountBeanLocal getAccountBeanLocal() throws NamingException, CreateException {
//        AccountBeanLocalHome home = (AccountBeanLocalHome) getInitialContext().lookup("AccountBean");
//        return home.create();
//    }
//
//    /**
//     * Get AccountInformationBeanLocal
//     * @return AccountInformationBeanLocal
//     * @throws NamingException
//     * @throws CreateException
//     */
//    public static AccountInformationBeanLocal getAccountInformationBeanLocal() throws NamingException, CreateException {
//        AccountInformationBeanLocalHome home = (AccountInformationBeanLocalHome) getInitialContext().lookup("AccountInformationBean");
//        return home.create();
//    }
//}
